<template>
	<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="scrolltolower" :style="{height:heightValue+'px'}">
		<!-- @click="jump('/pages/Activity/ActivityDetails')" -->
		<view class="activity-item" v-for="item in activityList" :key="item">
			<img :src="item.bgimg" alt="" class="activity-item-icon" />
			<view>
				{{item.title}}
			</view>
		</view>
		<uni-load-more :status="status" iconType="circle" :contentText="contentText"></uni-load-more>
	</scroll-view>
</template>

<!-- 热门活动 -->
<script>
	import {
		getHeight
	} from '@/utiles/utils.js';
	export default {
		data() {
			return {
				heightValue: 0,
				activityList: [{
					title: '蛋仔派对寻光冰雪季稀有盲盒上线时间预计将在12月1日正式上线。',
					bgimg: 'https://www.jk334.cn/img/activety-home-01.png'
				}, {
					title: '《元梦之星》美团皮肤',
					bgimg: 'https://www.jk334.cn/img/activety-home-02.png'
				}],
				status: 'more',
				contentText: {
					contentdown: "上拉显示更多",
					contentrefresh: "正在加载...",
					contentnomore: "没有更多数据了"
				},
			}
		},
		onShow() {
			const windowHeight = getHeight().windowHeight //100vh
			this.heightValue = windowHeight
		},
		methods: {
			scrolltolower() {
				const {
					taskList
				} = this
				this.status = 'loading'
				setTimeout(() => {
					if (taskList >= 120) {
						this.status = 'noMore'
					} else {
						this.taskList = taskList + 40
						this.status = 'more'
					}
				}, 5000)
				console.log('useAppStore')
			},
			jump(data) {
				uni.navigateTo({
					url: data
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.activity-item {
		background: #fff;
		padding: 40rpx 30rpx;
		border-bottom: #F2F2F2 solid 2rpx;
		font-size: 30rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		color: #000000;

		.activity-item-icon {
			width: 100%;
			height: 388rpx;
			border-radius: 16rpx;
		}
	}
</style>